LXMF fields
Part 1/2 • 4.8 KB total
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
This page is under heavy construction and may be outdated – most fields are considered experimental!
Common for all fields is that LXMF handles binary packing before sending. All fields must be passed in the specified format, often as a list with specific fields. Internally, LXMF uses MessagePack to pack data, so it can be efficiently transferred over the air/wire by Reticulum.
Contents
Embedded LXMs
Not yet fully implemented, and spec is likely to change.
| Constant | Index | Description | Content |
|---|---|---|---|
| FIELD_EMBEDDED_LXMS | 0x01 | | |
Telemetry
See the Sideband application source code for telemetry format info.
| Constant | Index | Description | Content |
|---|---|---|---|
| FIELD_TELEMETRY | 0x02 | Node telemetry, all enabled sensors | |
Telemetry stream
See the Sideband application source code for telemetry format info.
| Constant | Index | Description | Content |
|---|---|---|---|
| FIELD_TELEMETRY_STREAM | 0x03 | Aggregated downstream telemetry for bulk transfer | |
Appearance
| Constant | Index | Description | Content |
|---|---|---|---|
| LXMF.FIELD_ICON_APPEARANCE | 0x04 | Defines the icon that represents this node on the situation map. | [string ICON, byte[3] FG_COLOR, byte[3] BG_COLOR] |
Icon is a string with the name of a Material symbol. Searchable list
FG/BG color is an RGB color code from 000000 to FFFFFF.
Example code
# Displays a yellow hiker on a blue background
lxm_fields = { LXMF.FIELD_ICON_APPEARANCE: ["hiking",\xff\xff\x00,\x00\x00\xff] }
lxm = LXMF.LXMessage(dest, source, message_content, desired_method=LXMF.LXMessage.DIRECT, fields=lxm_fields)
File attachment
| Constant | Index | Description | Content |
|---|---|---|---|
| FIELD_FILE_ATTACHMENTS | 0x05 | List of file attachments | See example |
Example code
# Attach a file
file_name = "some_file.pdf"
with open(file_name, "rb") as att_file:
file_attachment_1 = [file_name, att_file.read()]
lxm_fields = { LXMF.FIELD_FILE_ATTACHMENTS: [file_attachment_1] }
lxm = LXMF.LXMessage(dest, source, message_content, desired_method=LXMF.LXMessage.DIRECT, fields=lxm_fields)
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────